package com.itheima.edu.info.manager.day6;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ShiJian {
    public static void main(String[] args) throws ParseException {
        String s = "2020-11-11 00:00:00";
        String s1 = "2020-11-11 00:10:00";
        String zhu = "2020-11-11 00:03:58";
        String liu = "2020-11-11 00:12:00";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long l = sdf.parse(s).getTime();
        long endl = sdf.parse(s1).getTime();
        long Zhu = sdf.parse(zhu).getTime();
        long Liu = sdf.parse(liu).getTime();
//     String ss= sdf.format(d);
//      String sss= sdf.format(c);

        if(Zhu>l&&Zhu<endl){
            System.out.println("恭喜抢到商品");
        }else {
            System.out.println("很遗憾，秒杀活动以结束");
        }
        if(Liu>l&&Liu<endl){
            System.out.println("恭喜抢到商品");
        }else {
            System.out.println("很遗憾，秒杀活动以结束");
        }
    }
}
